/**
 *
 */
package com.angel.email.dtos;

import javax.mail.Address;
import javax.mail.internet.InternetAddress;


/**
 * @author William
 *
 */
public class RecipientDTO {

	private String address;
	private String personal;
	private String type;

	public RecipientDTO(){
		super();
	}

	public RecipientDTO(Address address){
		this();
		InternetAddress ia = (InternetAddress) address;
		this.setAddress(ia.getAddress());
		this.setPersonal(ia.getPersonal());
		this.setType(ia.getType());
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @return the personal
	 */
	public String getPersonal() {
		return personal;
	}

	/**
	 * @param personal the personal to set
	 */
	public void setPersonal(String personal) {
		this.personal = personal;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	public String toString(){
		return this.getPersonal() + "[" + this.getAddress() + " - " + this.getType() + "]";
	}
}
